Fix the timestamps in LogEntry #192
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix timestamps in the LogEntry
Issue
This PR addresses Issue #190.
In rare cases when many logs are created in multiple threads the timestamps and Sequence numbers can become out of order. Each should only ever increase, and ordering a set of log entries by sequence should produce the same sequence as ordering by timestamp.
This fix, ensures that timestamps are only ever increasing. The resolution of the
DateTime.UtcNow
function is system dependent, so can be between 0.5ms to 15ms, or 5000 to 150,000 ticks (at 10,000 ticks per millisecond). So, in some scenarios, multiple log entries can be created before theDateTime.UtcNow
method produces a new value. In this event a newDateTime
is produces that increments the Ticks by 1 to ensure that the value is distinct from the preceding log entry.Check list
Required
release-notes/wip-release-notes.md
fileOptional
readme.md
file.readme.md
file.version.txt
.